#region head comment
/*
Code generate by YhdSdkTool.
email:starpeng@vip.qq.com
2013-01-21 23:00:57:777 +08:00
*/
#endregion

using System;
using System.Xml.Serialization;
using System.Collections.Generic;
using YhdSdk.Domain;
using YhdSdk.Domain.Group;
using YhdSdk.Response.Group;

namespace YhdSdk.Request.Group
{
    /// <summary>
    /// 团购报名信息上传
    ///<para></para>
    ///<para>从1号商城选择一个产品(单品)添加到团购平台，成功则返回成功记录数，失败则返回失败记录数和相应错误描述信息。</para>
    /// </summary>
    public class YhdGroupBuyProductAddRequest : IYhdRequest<YhdGroupBuyProductAddResponse>
    {
        /// <summary>
        /// 1号商城产品ID
        /// </summary>
        /// <example>3887112</example>
        [XmlElement("productId")]
        public Int64 ProductId
        {
            get;
            set;
        }

        /// <summary>
        /// 合作方团购ID(不超过20个字符)
        /// </summary>
        [XmlElement("outerGroupId")]
        public String OuterGroupId
        {
            get;
            set;
        }

        /// <summary>
        /// 团购产品名称(不超过300个字符)
        /// </summary>
        [XmlElement("groupCname")]
        public String GroupCname
        {
            get;
            set;
        }

        /// <summary>
        /// 团购产品分类ID
        /// </summary>
        [XmlElement("groupCategoryId")]
        public Int64 GroupCategoryId
        {
            get;
            set;
        }

        /// <summary>
        /// 团购价格(大于或等于0,最多两位小数)
        /// </summary>
        /// <example>39</example>
        [XmlElement("groupPrice")]
        public Double GroupPrice
        {
            get;
            set;
        }

        /// <summary>
        /// 团购购买数量下限(大于0)
        /// </summary>
        [XmlElement("minStockNum")]
        public Int32 MinStockNum
        {
            get;
            set;
        }

        /// <summary>
        /// 团购购买数量上限
        /// </summary>
        [XmlElement("maxStockNum")]
        public Int32 MaxStockNum
        {
            get;
            set;
        }

        /// <summary>
        /// 每人购买数量下限
        /// </summary>
        [XmlElement("minGroupNum")]
        public Nullable<Int32> MinGroupNum
        {
            get;
            set;
        }

        /// <summary>
        /// 每人购买数量上限(最大为99)
        /// </summary>
        /// <example>6</example>
        [XmlElement("maxGroupNum")]
        public Nullable<Int32> MaxGroupNum
        {
            get;
            set;
        }

        /// <summary>
        /// 团购预告时间(yyyy-MM-dd HH:mm:ss格式)
        /// </summary>
        [XmlElement("prepareTime")]
        public String PrepareTime
        {
            get;
            set;
        }

        /// <summary>
        /// 团购开始时间(yyyy-MM-dd HH:mm:ss格式)
        /// </summary>
        [XmlElement("startTime")]
        public String StartTime
        {
            get;
            set;
        }

        /// <summary>
        /// 团购结束时间(yyyy-MM-dd HH:mm:ss格式)
        /// </summary>
        [XmlElement("endTime")]
        public String EndTime
        {
            get;
            set;
        }

        /// <summary>
        /// 活动地区(可选多个省,多个省用逗号分隔)
        /// </summary>
        [XmlArray("saleAreaId")]
        [XmlArrayItem("int64")]
        public List<Int64> SaleAreaId
        {
            get;
            set;
        }

        /// <summary>
        /// Api接口名称
        /// </summary>
        public String ApiName
        {
            get{ return "yhd.group.buy.product.add"; }
        }

        /// <summary>
        /// 获取参数列表
        /// </summary>
        public IDictionary<string, string> GetParameters()
        {
            YhdDictionary parameters = new YhdDictionary();
            parameters.Add("productId" ,this.ProductId);
            parameters.Add("outerGroupId" ,this.OuterGroupId);
            parameters.Add("groupCname" ,this.GroupCname);
            parameters.Add("groupCategoryId" ,this.GroupCategoryId);
            parameters.Add("groupPrice" ,this.GroupPrice);
            parameters.Add("minStockNum" ,this.MinStockNum);
            parameters.Add("maxStockNum" ,this.MaxStockNum);
            parameters.Add("minGroupNum" ,this.MinGroupNum);
            parameters.Add("maxGroupNum" ,this.MaxGroupNum);
            parameters.Add("prepareTime" ,this.PrepareTime);
            parameters.Add("startTime" ,this.StartTime);
            parameters.Add("endTime" ,this.EndTime);
            parameters.Add("saleAreaId" ,this.SaleAreaId);
            return parameters;
        }

        /// <summary>
        /// 验证参数
        /// </summary>
        public void Validate()
        {
            RequestValidator.ValidateRequired("productId", this.ProductId);
            RequestValidator.ValidateRequired("outerGroupId", this.OuterGroupId);
            RequestValidator.ValidateRequired("groupCname", this.GroupCname);
            RequestValidator.ValidateRequired("groupCategoryId", this.GroupCategoryId);
            RequestValidator.ValidateRequired("groupPrice", this.GroupPrice);
            RequestValidator.ValidateRequired("minStockNum", this.MinStockNum);
            RequestValidator.ValidateRequired("maxStockNum", this.MaxStockNum);
            RequestValidator.ValidateRequired("startTime", this.StartTime);
            RequestValidator.ValidateRequired("endTime", this.EndTime);
            RequestValidator.ValidateRequired("saleAreaId", this.SaleAreaId);
        }

    }
}
